package view;

import java.awt.Dialog.ModalExclusionType;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JDesktopPane;
import javax.swing.JMenuItem;
import java.awt.event.ActionListener;
import javax.swing.JCheckBoxMenuItem;
import java.awt.SystemColor;

public class JPrincipal extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					JPrincipal frame = new JPrincipal();
					
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public JPrincipal() {
		setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
		setTitle("Mandula - Sistema ");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 636, 493);

		JMenuBar menuBar = new JMenuBar();
		setJMenuBar(menuBar);

		JMenu mnCadastros = new JMenu("Cadastros");
		menuBar.add(mnCadastros);

		JMenuItem mntmControleDeClientes = new JMenuItem("Controle de Clientes");
		mntmControleDeClientes.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				exibirJanelaCliente();

			}
		});
		mnCadastros.add(mntmControleDeClientes);

		JMenuItem mntmControleDeFornecedores = new JMenuItem(
				"Controle de Fornecedores");
		mnCadastros.add(mntmControleDeFornecedores);

		JMenu mnMovimentos = new JMenu("Movimentos");
		menuBar.add(mnMovimentos);

		JMenu mnAjuda = new JMenu("Ajuda");
		menuBar.add(mnAjuda);
		contentPane = new JPanel();
		contentPane.setBackground(SystemColor.windowBorder);
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		contentPane.setLayout(new BorderLayout(0, 0));
		setContentPane(contentPane);
	}
	private void exibirJanelaCliente(){
		JCliente jcliente = new JCliente(null, true);
		jcliente.setLocationRelativeTo(null);
		jcliente.setModal(true);
		jcliente.setResizable(false);
		jcliente.setVisible(true);
	}
}